package spec.ganlijuan.unit5;

import java.util.HashMap;

public class MapTest {
    public static void main(String[] args) {
        HashMap hm = new HashMap();
        System.out.println("刚开始化的时候Map元素数量：" + hm.size());
        hm.put("丁一", "王五");
        hm.put("赵二", "黄六");
        hm.put("张三", "宋七");
        hm.put("张三", "干脚");
        System.out.println("添加了四对元素后的Map元素的数量：" + hm.size());
        String s = (String)hm.get("张三");
        System.out.println(s);
        hm.put("秦四","王五");
        System.out.println(hm.get("丁一"));
        System.out.println(hm.get("秦四"));
    }
}
